package ema.jee.tp;

import java.util.Collection;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

public @Stateless class ApplicationBean implements Application {
	
	
	@PersistenceContext(unitName = "bankUnit")
	protected EntityManager em;

	public Bank addBank(Bank b) {
		em.persist(b);
		return b;
	}

	public Collection<Bank> listBank() {
		return em.createQuery("SELECT b FROM Bank b").getResultList();
	}


	

}
